<template>
  <div class="main" :style="{ overflow: flag ? 'hidden' : '' }">
    <!--  -->
    <router-view @get-player-id="getPlayerId" @get-play-all-id="getPlayAllId">
    </router-view>

    <!-- 播放器 -->
    <player
      v-show="playerId"
      :player-id="playerId"
      :list-id="listId"
      @get-player-id="getPlayerId"
    ></player>
  </div>
</template>

<script>
//引入播放器组件地址
import player from "./components/base/PlayerCom.vue";
export default {
  data() {
    return {
      playerId: null,
      listId: null,
      flag: false,
    };
  },
  //方法
  methods: {
    getPlayerId(id) {
      console.log(id); //拿到当前点击歌曲的id
      this.playerId = id;
    },
    getPlayAllId(id) {
      this.listId = id; //把传过来的id赋进去
    },
    //显示隐藏
    // notably(e) {
    //   console.log("value", e);
    //   this.flag = e;
    // },
  },
  //组件
  components: {
    player,
  },
};
</script>

<style lang="less" >
@import "./assets/css/base.css";
</style>
